import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import FootSwamp from '../components/FootSwamp.vue'
import ItemDetailspages from '../components/ItemDetailspages.vue'
import SkipFoodList from '../components/SkipFoodList.vue'
//FoodDetails 是逛吃跳转的路由
import FoodDetails from '../components/FoodDetails.vue'

import SheZhi from '../components/SheZhi.vue'
import DengLu from '../components/DengLu.vue'
import DengLu1 from '../components/DengLu1.vue'
import Dlzong from '../components/Dlzong.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
      appfalg: true,
      falg: false,
      keepAlive: true,
    },
  },
  {
    path: '/gongtoeat',
    name: 'GongToEat',
    //路由懒加载
    component: () => import(/* webpackChunkName: "about" */ '../views/GongToEat.vue'),
    meta: {
      appfalg: true,
      keepAlive: true,
    }
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'),
    meta: {
      appfalg: true,
      keepAlive: true,
    }
  },
  {
    path: '/footswamp',
    name: 'FootSwamp',
    component: FootSwamp,
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/itemdetailspages',
    name: 'ItemDetailspages',
    component: ItemDetailspages,
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import(/* webpackChunkName: "about" */ '../components/Search.vue'),
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/foodscontrast',
    name: 'FoodsContrast',
    component: () => import(/* webpackChunkName: "about" */ '../components/FoodsContrast.vue'),
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/foodrankingboard',
    name: 'FoodRankingBoard',
    component: () => import(/* webpackChunkName: "about" */ '../components/FoodRankingBoard.vue'),
    meta: {
      keepAlive: true,
    }

  },
  {
    path: '/skipfoodlist',
    name: 'SkipFoodList',
    component: SkipFoodList,
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/fooddetails',
    name: 'FoodDetails',
    component: FoodDetails,
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/shezhi',
    name: 'SheZhi',
    component: SheZhi,
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/denglu',
    name: 'DengLu',
    component: DengLu,
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/denglu1',
    name: 'DengLu1',
    component: DengLu1,
    meta: {
      keepAlive: false,
    }
  },
  {
    path: '/dlzong',
    name: 'Dlzong',
    component: Dlzong,
    meta: {
      keepAlive: false,
    }
  },
]

const router = new VueRouter({
  routes
})

export default router
